$(function () {
  
  module("Plugins");
 
  asyncTest("translator.translate()", function () {
    expect(1);
    stop(3000);    
    translator.translate({
      srcLang : "ENGLISH",
      destLang : "GERMAN",
      text : "hello world! whats going on?",
      success : function (data) {
       start();
       ok(data.length > 0, "callback function got some data");       
      },
      error : function (data) {
        ok(false, "error callback was fired");
      }});    
  });  
  
  asyncTest("translator.detect()", function () {
    expect(2);
    stop(3000);
    translator.detect({
      text: "Hello world! what's going on?",
      callBack : function (data) {
       start();
       ok(("name" in data) && ("code" in data), "callback got a language object");
       ok(data.code == "en", "correct language object returned");
      },
      error : function (data) {
        ok(false, "error callback was fired");
      }
    });    
  });
  
});


//  translator.translatePage({dom : gBrowser.contentDocument, destLang : "ENGLISH", callBack : function () {},error : function () {}});
